<template>
  <div class="cjui-echart-loading">
    <div class="container-box">
      <span></span>
      <span></span>
      <span></span>
      <span></span>
      <span></span>
    </div>
  </div>
</template>

<style lang="scss">
.cjui-echart-loading {
  --cjui-loading-width: 50px;
  --cjui-loading-height: 50px;
  --cjui-loading-color: var(--cjui-color-primary);

  width: var(--cjui-loading-width);
  height: var(--cjui-loading-height);
  display: inline-block;
  box-sizing: border-box;
  position: relative;

  .container-box {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .container-box > span {
    background-color: var(--cjui-loading-color);
    width: 8%;
    height: 72%;
    border-radius: 2px;
    margin: 0 2px;
    display: inline-block; 
    animation-name: cjui-echart-loading;
    animation-duration: 0.75s;
    animation-timing-function: cubic-bezier(.2, .68, .18, 1.08);
    animation-iteration-count: infinite; 
    animation-fill-mode: both;
  }
  .container-box > span:nth-child(1) {
    animation-delay: 0.1s;
  }
  .container-box > span:nth-child(2) {
    animation-delay: 0.2s;
  }
  .container-box > span:nth-child(3) {
    animation-delay: 0.3s;
  }
  .container-box > span:nth-child(4) {
    animation-delay: 0.4s;
  }
  .container-box > span:nth-child(5) {
    animation-delay: 0.5s;
  }
}

@keyframes cjui-echart-loading {
  0% { transform: scaley(1); }
  50% { transform: scaley(0.4); }
  100% { transform: scaley(1); } 
}
</style>